package com._54programer.ioc.config.config.lifecycle;

import com._54programer.ioc.config.beans.lifecycle.Cat;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;

/**
 * 2.实现InitializingBean, DisposableBean方法来完成Bean的初始化和销毁逻辑
 *
 * Cat create
 * Cat afterPropertiesSet  实现InitializingBean的方法
 * Cat initCat
 * Cat destroy             实现DisposableBean的方法
 * Cat destroyCat
 *
 */
@Configurable
public class BeanConfig2 {


    @Bean(initMethod = "initCat", destroyMethod = "destroyCat")
    public Cat cat(){
        return new Cat();
    }


}
